<script setup lang="ts">
import { inBox } from '@/utils/getUid'
import type { AssistantProps } from '@/type'

interface AssistantCardProps extends AssistantProps {
  hadCompleted: boolean
}

const props = defineProps<AssistantCardProps>()
</script>
<template>
  <div
    class="lzc-assistant-card max-w-[470px] w-[100%] h-[100px] flex select-none cursor-pointer"
  >
    <div
      class="img-area w-[178px] h-full overflow-hidden rounded-[8px] bg-[#F5F5F6] shadow-lg"
    >
      <img
        :src="props.thumbnail.pc + '?imageMogr2/thumbnail/500x'"
        draggable="false"
        class="object-cover h-full w-full overflow-hidden"
      />
    </div>
    <div class="flex-1 h-full pl-[20px]">
      <div class="flex items-center">
        <div
          class="title text-[#202020] text-[18px] font-medium leading-[27px] line-clamp-1"
        >
          {{ props.title }}
        </div>
        <div
          v-if="!hadCompleted && inBox"
          class="ml-1 w-[30px] min-w-[30px] h-[14px] rounded-[7px] bg-[#EF504F] text-[10px] text-white leading-[14px] text-center"
        >
          NEW
        </div>
      </div>

      <div
        class="desc text-[#666666] text-[14px] font-normal leading-[20px] mt-[1px] line-clamp-3"
      >
        {{ props.introduction }}
      </div>
    </div>
  </div>
</template>
<style scoped lang="scss">
.lzc-assistant-card:hover {
  .img-area {
    transform: scale(1.05);
    transition: transform 0.3s ease;
  }
  .title {
    color: #29b9c5;
    transition: color 0.3s ease;
  }
  .desc {
    color: #29b9c5;
    transition: color 0.3s ease;
  }
}
</style>
